package com.cooper.dao.core;

import java.util.List;

import net.paoding.rose.jade.annotation.DAO;
import net.paoding.rose.jade.annotation.SQL;

import com.cooper.entity.Dict;

@DAO
public interface DictDAO {

	@SQL("select distinct(dict_code) from srd_dict_info where deleted='n' ")
	List<String> listAllNames() throws Exception;
	
	@SQL("select dict_code,dict_name,dict_value from srd_dict_info where deleted='n' and dict_code=:1")
	List<Dict> getDict(String resName) throws Exception;
	
	@SQL("select dict_code,dict_name,dict_value from srd_dict_info where deleted='n' and dict_code=:1 and dict_name in (:2) order by sort_no asc")
	List<Dict> getDictListByKeys(String resName, List<String> keyList) throws Exception;
	
	@SQL("select dict_value from srd_dict_info where deleted='n' and dict_code=:1 and dict_name=:2")
	String getResValue(String resName, String key) throws Exception;
	
	@SQL("select dict_value from srd_dict_info where deleted='n' and dict_code=:1 ")
	List<String> getResValueList(String resName) throws Exception;
}
